cmake_minimum_required(VERSION 3.5)

project(ACL_YOLOV3)

#if you use x86 host,disable compiler option
SET(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
SET(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")

add_definitions(-std=c++11)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})

set(OpenCV_DIR /home/atlas/opencv_4.4_aarch64/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)

set(ACL_PATH /home/atlas/Ascend/ascend-toolkit/latest)
INCLUDE_DIRECTORIES(
    ${ACL_PATH}/acllib/include
    ${OpenCV_INCLUDE_DIRS}
    AclProcess
    )

set(ACL_LIB_PATH ${ACL_PATH}/acllib/lib64/stub)
link_directories(${ACL_LIB_PATH})

add_executable(${PROJECT_NAME}
    main.cpp
    AclProcess/AclProcess.cpp
    AclProcess/ModelProcess.cpp
    )

target_link_libraries(${PROJECT_NAME} ascendcl ${OpenCV_LIBS} pthread -Wl,-z,relro,-z,now,-z,noexecstack -pie -s stdc++)
